<template>
  <div class="introduce  mt-4 pl-4">
    <div class="row introduce-con">
      <div class="col col-12 col-sm-12 col-md-4 col-lg-4">
        <img class="align-self-end mr-4" :src="getHeadUrl(employee.headImg)">
      </div>
      <div class="media-body col col-12 col-sm-12 col-md-8 col-lg-8">
        <h5 class="mb-2">{{employee.name}}</h5>
        <ul class="list d-none d-sm-none d-md-block d-lg-block">
          <li class="d-flex">
            <div class="left">
              <p>
                职称：
              </p>
            </div>
            <div class="right">
              <p v-for="job in getArray(employee.jobTitleLabel, 5)">{{job}}</p>
            </div>
          </li>
          <li class="d-flex">
            <div class="left">
              <p>
                擅长：
              </p>
            </div>
            <div class="right">
              <p v-for="job in getArray(employee.skill,5)">{{job}}</p>
            </div>
          </li>
          <li class="d-flex">
            <div class="left">
              <p>
                荣誉：
              </p>
            </div>
            <div class="right">
              <p v-for="job in getArray(employee.honor,5)">{{job}}</p>
            </div>
          </li>
        </ul>
        <div class="tab d-block d-sm-block d-md-none d-lg-none">
          <div class="tab-top">
            <div @click="select(0)" :class="{'active':currentIndex==0}">职称</div>
            <div @click="select(1)" :class="{'active':currentIndex==1}">擅长</div>
            <div @click="select(2)" :class="{'active':currentIndex==2}">荣誉</div>
          </div>
          <div class="tab-con" v-if="currentIndex == 0">
            <p v-for="job in getArray(employee.jobTitleLabel, 5)">{{job}}</p>
          </div>
          <div class="tab-con" v-if="currentIndex == 1">
            <p v-for="job in getArray(employee.skill,5)">{{job}}</p>
          </div>
          <div class="tab-con" v-if="currentIndex == 2">
            <p v-for="job in getArray(employee.honor,5)">{{job}}</p>
          </div>
        </div>
      </div>
    </div>
    <div class="text">
      <iframe-com v-if="(employee.profileHtml !== undefined)" :html="employee.profileHtml"></iframe-com>
    </div>
    <div class="bottom-button mt-3">
      <span v-if="false" @click="go(company)">点击咨询</span>
      <span @click="showCode">我要预约</span>
    </div>
  </div>

</template>

<script>

  import IframeCom from "./iframeCom";

  export default {
    props:['employee', 'company'],
    computed: {},
    data() {
      return {
        currentIndex:0
      }
    },
    components: {IframeCom},
    mounted() {

    },
    methods: {
      showCode() {
        this.$emit('show-code', true);
      },
      go(company) {
        if (!this.isNullOrEmpty(company) && !this.isNullOrEmpty(company.qq)) {
          window.open(company.qq);
        }
      },
      select(index){
        this.currentIndex = index
      }
    }
  }
</script>

<style lang="less" scoped>
  @import "~assets/style/public";

  .introduce {
    .align-self-end{
      img{
        vertical-align: top;
        margin-top: 20/@size;
        max-width: 300/@size;
        max-height: 400/@size;
      }
    }
    ul, li {
      list-style: none;
    }
    .media-body {
      .left{
        min-width: 60/@size;
      }
      h5 {
        font-family: MicrosoftYaHeiUI-Bold;
        font-size: 18/@size;
        color: #222222;
        letter-spacing: 0;
        font-weight: bold;
      }
      .list {
        p {
          font-family: MicrosoftYaHeiUI;
          font-size: 18/@size;
          line-height: 28/@size;
          margin: 0;
          color: #222222;
          letter-spacing: 0;
        }
      ;
      }
    }
    .text {
      p {
        font-family: MicrosoftYaHeiUI;
        font-size: 14/@size;
        color: #222222;
        letter-spacing: 0;
        line-height: 30px;
        justify-content: center;
        text-indent: 2em;
      }
    }
    .bottom-button{
      display: flex;
      justify-content:center;
      span{
       display: block;
        .padding(10,20,10,20);
        font-family: MicrosoftYaHeiUI;
        font-size: 16/@size;
        color: #FFFFFF;
        letter-spacing: 0;
        text-align: center;
        background: #20A0FF;
        margin-right: 30/@size;
        &:last-child{
          background: #FF7121;
        }
        cursor: pointer;
      }
    }
  }

  @media (min-width: 320px) and (max-width:767px) {
    .introduce {
      img{
        margin: 0 auto !important;
      }
      .media-body {
        h5 {
          font-family: @font-title;
          font-size: @font-30;
          margin-top: 30/@size;
          margin-bottom: 48/@size !important;
          text-align: center;
        }
      }

      .tab{
        .tab-top{
          display: flex;
          justify-content: space-around;
          align-items: center;
          .height(82);
          border-bottom: 1px solid #C0C4CC;
          >div{
            min-width: 140/@size;
            text-align: center;
            height: 100%;
            font-size: @font-30;
            color: #666666;
          }
          .active{
            border-bottom: 2px solid @theme-color;
            color: @theme-color;
          }
        }
        .tab-con{
          display: flex;
          flex-direction: column;
          justify-content: center;
          padding: 20/@size 0 30/@size 0;
          p {
            text-align: center;
            font-size: @font-30;
            font-family: @font-title;
            color: @black-color-0-5;
            line-height: 48/@size;
          }
        }
      }
      .bottom-button{
        margin-bottom: 30/@size;
        span{
          font-size: @font-30;
          .width(180);
          .height(68);
        }
      }
    }
  }




</style>
